<?php
	// Verification si il y a des pieces jointes :
	$PJExist = false;
	$reqPJ = "SELECT * FROM pieces_jointes WHERE idPagePj = ".$idSsPage."";
	$queryPJ = $bdd->query($reqPJ);
	while ($PJ = $queryPJ->fetch()){
		$PJExist = true;
	}$queryPJ->closeCursor();
	
	if ($PJExist){
		// Si il y en a, on les affiche
		$queryPJ = $bdd->query($reqPJ);
		while ($PJ = $queryPJ->fetch()){
			echo '<img src="../img/icons/'.substr($PJ['fichierPj'], -3).'-icon.png" /> <a href="../piecesJointes/'.$PJ['fichierPj'].'" target="_blank">'.$PJ['libellePj'].'</a><br/>';
		}$queryPJ->closeCursor();
	}
?>